# Maintainer: atom2013 <atom.long@hotmail.com>

_realname=pyparsing
pkgbase="python-${_realname}"
pkgname=("python3-${_realname}" "python2-${_realname}")
pkgver=2.2.0
pkgrel=3
pkgdesc='General parsing module for Python'
arch=('any')
url='https://pyparsing.wikispaces.com/'
makedepends=('python3-setuptools' 'python2-setuptools' 'subversion')
license=('MIT')
source=("https://downloads.sourceforge.net/pyparsing/${_realname}-${pkgver}.tar.gz")
sha256sums=('0832bcf47acd283788593e7a0f542407bd9550a55a8a8435214a1960e04bcb04')

prepare() {
  cp -a pyparsing-${pkgver}{,-py2}
}

build() {
  # Build python 3 module
  cd "${srcdir}"/${_realname}-${pkgver}
  python3 setup.py build

  # Build python 2 module
  cd "${srcdir}"/${_realname}-${pkgver}-py2
  python2 setup.py build
}

package_python3-pyparsing() {
  depends=('python3')

  cd ${_realname}-${pkgver}

  python3 setup.py install --prefix=/usr --root="${pkgdir}" --optimize=1
  install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
}

package_python2-pyparsing() {
  depends=('python2')

  cd ${_realname}-${pkgver}-py2

  python2 setup.py install --prefix=/usr --root="${pkgdir}" --optimize=1
  install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
}

# vim:set ts=2 sw=2 et:
